package com.wzcl.app.model.vo;

import com.wzcl.app.dao.model.Channel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

@Data
public class ChannelVo extends BaseVo{

    @ApiModelProperty(value = "直播频道ID")
    private Integer channelId;

    @ApiModelProperty(value = "网页开播链接")
    private String webStartUrl;

    @ApiModelProperty(value = "启动链接")
    private String startUrl;

    @ApiModelProperty(value = "密码")
    private String channelPasswd;

    private ChannelVo() {
    }

    public static ChannelVo create(Channel channel){
        ChannelVo channelVo = new ChannelVo();
        channelVo.setChannelId(channel.getChannelId());
        channelVo.setChannelPasswd(channel.getChannelPasswd());
        channelVo.translationValueStr();
        return channelVo;
    }



    @Override
    public void translationValueStr() {
        this.startUrl = String.format("https://live-manage.wzclzx.com/start-client.html?channelId=%d",this.channelId);
        this.webStartUrl = String.format("https://live-manage.wzclzx.com/web-start/classroom?channelId=%d",this.channelId);
    }

    @Override
    public void processResources() {

    }
}
